package com.oocl.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.oocl.dao.GoodsDao;
import com.oocl.dao.WareHouseDao;
import com.oocl.dao.impl.GoodsDaoImpl;
import com.oocl.dao.impl.WareHouseDaoImpl;
import com.oocl.pojo.Goods;

public class UpdateServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private WareHouseDao wareDao;
	private GoodsDao goodsDao;
    public UpdateServlet() {
        super();
        goodsDao = new GoodsDaoImpl();
        wareDao = new WareHouseDaoImpl();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String id = request.getParameter("id");
		Goods goods = goodsDao.loadGoods(id);
		request.getSession().setAttribute("goods", goods);
		request.getRequestDispatcher("../update.jsp").forward(request, response);
	}

}
